import { createApp } from "vue";
import Antd from "ant-design-vue";

import App from "./App.vue";
import Panel from "../devtools/Panel.vue";
import Home from "../home/index.vue";

import "ant-design-vue/dist/reset.css";

import ElementPlus from "element-plus";
import "element-plus/dist/index.css";
import * as ElementPlusIconsVue from "@element-plus/icons-vue";
const app = createApp(App);
const panel = createApp(Panel);
const homePage = createApp(Home);
let currentApp = null;

if (window.location.pathname === "/devtools/index.html") {
  currentApp = panel;
} else if (window.location.pathname === "/home/index.html") {
  currentApp = homePage;
} else {
  currentApp = app;
}
for (const [key, component] of Object.entries(ElementPlusIconsVue)) {
  currentApp.component(key, component);
}
currentApp.use(Antd).use(ElementPlus).mount("#app");